<?
include_once('db_setup.php');
$table = $_REQUEST['table'];
$recordID = $_REQUEST['recordID'];
$query = "SELECT * from $table where id=$recordID";
$result = mysql_query($query); 
$rows = 0;
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
//	$temp = json_decode($row['json'], true);
//	array_push($row,$temp);
	$output[] = $row;
//	$output[] = $temp;
	$rows = $rows + 1;
}
$data = json_encode($output);  //encode the data in json format
echo '({"total":"' . $rows . '","results":' . $data . '})';
?>
